<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - Rust知识解释智能体</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
    <div class="auth-container">
        <div class="auth-card">
            <!-- 头部 -->
            <div class="auth-header">
                <h1><i class="fas fa-robot"></i> Rust知识解释智能体</h1>
                <p>智能问答 · 多轮对话 · 个性化讲解</p>
            </div>

            <!-- 登录表单 -->
            <form id="loginForm" class="auth-form">
                <div class="form-group">
                    <label for="username">
                        <i class="fas fa-user"></i> 用户名
                    </label>
                    <input 
                        type="text" 
                        id="username" 
                        name="username" 
                        placeholder="请输入用户名"
                        value="admin"
                        required
                    >
                </div>

                <div class="form-group">
                    <label for="password">
                        <i class="fas fa-lock"></i> 密码
                    </label>
                    <div class="password-input">
                        <input 
                            type="password" 
                            id="password" 
                            name="password" 
                            placeholder="请输入密码"
                            value="123456"
                            required
                        >
                        <button type="button" class="toggle-password" onclick="togglePassword()">
                            <i class="fas fa-eye"></i>
                        </button>
                    </div>
                </div>

                <div class="form-group">
                    <label class="checkbox-label">
                        <input type="checkbox" id="rememberMe" checked>
                        <span class="checkmark"></span>
                        记住我
                    </label>
                </div>

                <button type="submit" class="auth-btn login-btn">
                    <i class="fas fa-sign-in-alt"></i>
                    登录
                </button>

                <div class="auth-divider">
                    <span>或者</span>
                </div>

                <button type="button" class="auth-btn register-btn" onclick="showRegister()">
                    <i class="fas fa-user-plus"></i>
                    注册新账户
                </button>
            </form>

            <!-- 注册表单 -->
            <form id="registerForm" class="auth-form" style="display: none;">
                <div class="form-group">
                    <label for="regUsername">
                        <i class="fas fa-user"></i> 用户名
                    </label>
                    <input 
                        type="text" 
                        id="regUsername" 
                        name="username" 
                        placeholder="请输入用户名"
                        required
                    >
                </div>

                <div class="form-group">
                    <label for="regEmail">
                        <i class="fas fa-envelope"></i> 邮箱
                    </label>
                    <input 
                        type="email" 
                        id="regEmail" 
                        name="email" 
                        placeholder="请输入邮箱"
                        required
                    >
                </div>

                <div class="form-group">
                    <label for="regPassword">
                        <i class="fas fa-lock"></i> 密码
                    </label>
                    <div class="password-input">
                        <input 
                            type="password" 
                            id="regPassword" 
                            name="password" 
                            placeholder="请输入密码"
                            required
                        >
                        <button type="button" class="toggle-password" onclick="toggleRegPassword()">
                            <i class="fas fa-eye"></i>
                        </button>
                    </div>
                </div>

                <div class="form-group">
                    <label for="regConfirmPassword">
                        <i class="fas fa-lock"></i> 确认密码
                    </label>
                    <div class="password-input">
                        <input 
                            type="password" 
                            id="regConfirmPassword" 
                            name="confirmPassword" 
                            placeholder="请再次输入密码"
                            required
                        >
                        <button type="button" class="toggle-password" onclick="toggleRegConfirmPassword()">
                            <i class="fas fa-eye"></i>
                        </button>
                    </div>
                </div>

                <div class="form-group">
                    <label class="checkbox-label">
                        <input type="checkbox" id="agreeTerms" required>
                        <span class="checkmark"></span>
                        我同意 <a href="#" class="terms-link">服务条款</a> 和 <a href="#" class="terms-link">隐私政策</a>
                    </label>
                </div>

                <button type="submit" class="auth-btn register-submit-btn">
                    <i class="fas fa-user-plus"></i>
                    注册
                </button>

                <div class="auth-divider">
                    <span>或者</span>
                </div>

                <button type="button" class="auth-btn login-back-btn" onclick="showLogin()">
                    <i class="fas fa-sign-in-alt"></i>
                    返回登录
                </button>
            </form>

            <!-- 默认用户提示 -->
            <div class="default-users">
                <h4><i class="fas fa-info-circle"></i> 默认用户</h4>
                <div class="user-list">
                    <div class="user-item">
                        <strong>管理员:</strong> admin / 123456
                    </div>
                    <div class="user-item">
                        <strong>学生:</strong> student / 123456
                    </div>
                    <div class="user-item">
                        <strong>教师:</strong> teacher / 123456
                    </div>
                </div>
            </div>

            <!-- 状态提示 -->
            <div id="statusMessage" class="status-message" style="display: none;"></div>
        </div>
    </div>

    <script src="{{ url_for('static', filename='js/auth.js') }}"></script>
</body>
</html> 